import request from '@/router/axios';

export const getIntegralList = (page, size, params) => {
  return request({
    url: '/order/sellerOrderForm/integralOrderlist',
    method: 'post',
    params: {
      ...params,
      page,
      size,
    }
  })
}

export const getList = (page, size, params) => {
  return request({
    url: '/order/sellerOrderForm/list',
    method: 'post',
    params: {
      ...params,
      page,
      size,
    }
  })
}
export const getDetail = (orderFormId) => {
  return request({
    url: '/order/sellerOrderForm/detail',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      orderFormId
    }
  })
}

export const add = (row) => {
  return request({
    url: '/order/sellerOrderForm/add',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/order/sellerOrderForm/edit',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const changeStatus = (userId, status) => {
  return request({
    url: '/order/sellerOrderForm/changeStatus',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
      status
    }
  })
}
export const approveOrder = (orderId) => {
  return request({
    url: '/order/sellerOrderForm/approveOrder',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      orderId,
    }
  })
}
export const cancelOrder = (orderFormId,cancelReason) => {
  return request({
    url: '/order/sellerOrderForm/cancelOrder',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      orderFormId,
	  cancelReason
    }
  })
}
export const refundOrder = (orderId) => {
  return request({
    url: '/order/sellerOrderForm/refundOrder',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      orderId
    }
  })
}
export const refundSuccess = (orderId, status) => {
  return request({
    url: '/order/sellerOrderForm/refundSuccess',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      orderId,
	   status
    }
  })
}
export const getOrderAddress = (orderId) => {
  return request({
    url: 'order/sellerOrderForm/getOrderAddress',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      orderId
    }
  })
}
export const modifyOrderAddress = (data) => {
  return request({
    url: 'order/sellerOrderForm/modifyOrderAddress',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: data
  })
}
export const getOrderAmount = (orderId) => {
  return request({
    url: 'order/sellerOrderForm/getOrderAmount',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
		orderId
	}
  })
}
export const updatePrice = (data) => {
  return request({
    url: 'order/sellerOrderForm/updatePrice',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: data
  })
}
export const getOrderFormGoods = (data) => {
  return request({
    url: 'order/sellerOrderFormGoods/list',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: data
  })
}
export const getCallbackIdByPayFormId = (data) => {
  return request({
    url: '/pay/pay/getCallbackIdByPayFormId',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: data
  })
}